bugfix/CSTACKEX-169: Fix enum case sensitive issues#53
Open
piyush5netapp wants to merge 1 commit intomainfrom
Open
bugfix/CSTACKEX-169: Fix enum case sensitive issues#53piyush5netapp wants to merge 1 commit intomainfrom
piyush5netapp wants to merge 1 commit intomainfrom
Conversation
suryag1201
reviewed
Apr 28, 2026
| if (text == null) return null; | ||
| for (ProtocolsEnum b : ProtocolsEnum.values()) { | ||
| if (String.valueOf(b.value).equals(text)) { | ||
| if (b.value.equalsIgnoreCase(text)) { |
There was a problem hiding this comment.
This would cause NPE if b.value is null.
Add null check for b.value or add a opposite condition like text.equalsIgnoreCase(b.value)
suryag1201
requested changes
Apr 28, 2026
| if (text == null) return null; | ||
| for (OsTypeEnum b : OsTypeEnum.values()) { | ||
| if (String.valueOf(b.value).equals(text)) { | ||
| if (b.value.equalsIgnoreCase(text)) { |
There was a problem hiding this comment.
This would cause NPE if b.value is null.
Add null check for b.value or add a opposite condition like text.equalsIgnoreCase(b.value)
| if (text == null) return null; | ||
| for (ProtocolEnum b : ProtocolEnum.values()) { | ||
| if (String.valueOf(b.value).equals(text)) { | ||
| if (b.value.equalsIgnoreCase(text)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR...
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
By creating a VM instance. Here is snippet of logs.
2026-04-28 10:13:45,025 INFO [o.a.c.s.f.FeignConfiguration] (Work-Job-Executor-1:[ctx-a3544284, job-35/job-36, ctx-cd6a1c15]) (logid:cef3100b) Body: {"name":"/vol/testSAN1/ROOT_6","os_type":"linux","space":{"size":188743680},"svm":{"name":"WLMDB_VS1"}}
2026-04-28 10:13:45,075 DEBUG [o.a.c.s.f.FeignConfiguration] (Work-Job-Executor-1:[ctx-a3544284, job-35/job-36, ctx-cd6a1c15]) (logid:cef3100b) Decoding JSON response: {
"num_records": 1,
"records": [
{
"uuid": "16ac3c6e-4bf3-4581-9ce4-cf66add1f980",
"svm": {
"uuid": "df666364-5a1e-11ef-b9b5-00a098b4ac56",
"name": "WLMDB_VS1",
"_links": {
"self": {
"href": "/api/svm/svms/df666364-5a1e-11ef-b9b5-00a098b4ac56"
}
}
},
"name": "/vol/testSAN1/ROOT_6",
"location": {
"logical_unit": "ROOT_6",
"node": {
"name": "WFDB-node1",
"uuid": "b93df103-2a2b-11ef-b0c5-00a098b4ac56",
"_links": {
"self": {
"href": "/api/cluster/nodes/b93df103-2a2b-11ef-b0c5-00a098b4ac56"
}
}
},
"volume": {
"uuid": "26282889-42e2-11f1-bf0f-00a098b4ac56",
"name": "testSAN1",
"_links": {
"self": {
"href": "/api/storage/volumes/26282889-42e2-11f1-bf0f-00a098b4ac56"
}
}
}
},
"class": "regular",
"create_time": "2026-04-28T09:47:51+00:00",
"enabled": true,
"os_type": "linux",
"serial_number": "80C/e+WyWIF7",
"space": {
"scsi_thin_provisioning_support_enabled": false,
"size": 188743680,
"used": 0,
"guarantee": {
"requested": false,
"reserved": false
}
},
"status": {
"container_state": "online",
"mapped": false,
"read_only": false,
"state": "online"
},
"vvol": {
"is_bound": false
},
"_links": {
"self": {
"href": "/api/storage/luns/16ac3c6e-4bf3-4581-9ce4-cf66add1f980"
}
}
}
]
}
2026-04-28 10:13:45,080 DEBUG [o.a.c.s.s.UnifiedSANStrategy] (Work-Job-Executor-1:[ctx-a3544284, job-35/job-36, ctx-cd6a1c15]) (logid:cef3100b) createCloudStackVolume: LUN created successfully. Lun: class Lun {
autoDelete: null
propertyClass: regular
enabled: true
lunMaps: null
name: /vol/testSAN1/ROOT_6
osType: linux
serialNumber: 80C/e+WyWIF7
space: class LunSpace {
scsiThinProvisioningSupportEnabled: false
size: 188743680
used: 0
physicalUsed: null
}
svm: org.apache.cloudstack.storage.feign.model.Svm@3d3d1717
uuid: 16ac3c6e-4bf3-4581-9ce4-cf66add1f980
}
How did you try to break this feature and the system with this change?